<extend name="./base" />
<block name="body">
    <link rel="stylesheet" href="/Public/admin/order/order.css">
    <nav class="tab-btn">
        <a href="/Admin/Comment/index/tab/1" class="btn <if condition="($tab eq 1) ">active</if>">全部</a>
        <a href="/Admin/Comment/index/tab/2" class="btn <if condition="($tab eq 2) ">active</if>">待审核</a>
    </nav>
    <table class="table" id="tableLists">
        <thead>
        <tr>
            <th>订单号</th>
            <th>老师姓名</th>
            <th>学生姓名</th>
            <th>上课时间</th>
            <th>上课内容</th>
            <th>评价内容</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="lists" item="list">
            <if condition="($tab eq 2) ">
                <if condition="($list.is_shenhe eq 0) ">
                    <tr>
                        <td>{$list.order_sn}</td>
                        <td>{$list.teacher_name}</td>
                        <td>{$list.student_name}</td>
                        <td>{$list.eventtime}</td>
                        <td>{$list.remark}</td>
                        <td>
                            <p>
                                <span>总评价<em>{$list.total}</em>分</span>
                            </p>
                            <p>
                                <span>知识准确度<em>{$list.accuracy}</em>分</span>
                            </p>
                            <p>
                            <span>内容充实度<em>{$list.enrich}</em>分</span>

                            </p>
                            <p>
                            <span>讲解透彻度<em>{$list.easy}</em>分</span>

                            </p>
                            <p>
                            <span>讲解熟练度<em>{$list.experience}</em>分</span>

                            </p>
                            <p>
                            <span>思维敏锐度<em>{$list.fast}</em>分</span>
                            </p>
                            <p>
                                <span>评论:{$list.remark}</span>
                            </p>
                        </td>
                        <td>
                             <select name="" id="" class="handle" data-is_shenhe="{$list.is_shenhe}" data-log_id="{$list.log_id}">
                               <option value="0">待处理</option>
                                <option value="1" <if condition="($list.is_shenhe eq 1)"> selected=""</if>>已处理</option>
                            </select>
                        </td>
                    </tr>
                </if>
            <else/>
                <tr>
                    <td>{$list.order_sn}</td>
                    <td>{$list.teacher_name}</td>
                    <td>{$list.student_name}</td>
                    <td>{$list.eventtime}</td>
                    <td>{$list.content}</td>
                    <td>
                        <p>
                        <span>总评价<em>{$list.total}</em>分</span>
                        </p>
                        <p>
                        <span>知识准确度<em>{$list.accuracy}</em>分</span>
                        </p>
                        <p>
                        <span>内容充实度<em>{$list.enrich}</em>分</span>

                        </p>
                        <p>
                        <span>讲解透彻度<em>{$list.easy}</em>分</span>

                        </p>
                        <p>
                        <span>讲解熟练度<em>{$list.experience}</em>分</span>

                        </p>
                        <p>
                        <span>思维敏锐度<em>{$list.fast}</em>分</span>
                        </p>
                        <p>
                            <span>评论:{$list.remark}</span>
                        </p>
                    </td>
                    <td>
                         <select name="" id="" class="handle" data-is_shenhe="{$list.is_shenhe}" data-log_id="{$list.log_id}">
                           <option value="0">待处理</option>
                            <option value="1" <if condition="($list.is_shenhe eq 1)"> selected=""</if>>已处理</option>
                        </select>
                    </td>
                </tr>
            </if>


        </foreach>
        </tbody>
    </table>

    <div>
        {$render}
    </div>
    <script type="text/javascript">
        $('#tableLists').on('change', '.handle', function() {
            var data = {
                is_shenhe: $(this).val(),
                log_id: $(this).attr('data-log_id')
            }
            $.ajax({
                url: '/Admin/Comment/shenheComment',
                data: data,
                type: 'post',
                dataType: 'json'
            })
            .done(function(res) {
                if (res.error) {
                    res.msg && alert(res.msg);
                }
                else {
                    location.reload();
                }
            })
        });
    </script>
</block>
